﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using System.Data.OleDb;
using System.Data;

public partial class Admin_Test : System.Web.UI.Page
{
	private DLL.Department.Component clsDepartmentComp;

	protected void Page_Load(object sender, EventArgs e)
	{
		Response.Write(clsDepartmentComp.QueryChildDepartmentID(8));
	}

	protected override void OnInit(EventArgs e)
	{
		clsDepartmentComp = new DLL.Department.Component(Page);

		base.OnInit(e);

		BtnText.Click += new EventHandler(BtnText_Click);
	}

	void BtnText_Click(object sender, EventArgs e)
	{
		

			string strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Book1.xls;Extended Properties=Excel 8.0;";

				OleDbConnection conn = new OleDbConnection(strConn);

				OleDbDataAdapter oada = new OleDbDataAdapter("SELECT * FROM [Sheet1$]", strConn);

				DataSet ds = new DataSet();

				oada.Fill(ds);

				//DataTable dtJWTYBH = ds.Tables["xlsTable"];

				//for (int i = 0; i < dtJWTYBH.Rows.Count; i++)
				//{
				//        DataRow dr = dtJWTYBH.Rows[i];

				//        Response.Write(dr[i].ToString());
				//}
			
		
	}
}